package adv41;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread1 extends Thread {
    public Thread1(String name){
        super(name);
    }
    @Override
    public void run() {
        for (int i = 1; i <= 20; i++) {
            System.out.println(this.getName()+" print "+i);
            try {
                sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        for (int i =1; i <=5 ; i++) {
            //start并不会调用run
            new Thread1("线程"+i).start();
            // new Thread1("线程"+i).run();
        }
        System.out.println("打印结束了。。。");
    }
}
